<!DOCTYPE html>
<html class="no-js" lang="zh">
  <head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="alternate" href="https://www.desgard.com" hreflang="pt-BR">
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="theme-color" content="#005344">
<title>Guardia · 瓜地</title>
<meta name="google-site-verification" content="zS1dSn20XtA4FJYEOQLXqI0boxZdMnJ2g3beje-cl20">
<meta name="description" content="I write many code to write less code.💻 - Página 3 ">
<meta name="keywords" content="">
<!-- Social: Facebook / Open Graph -->
<meta property="og:url" content="https://www.desgard.com/page/3/">
<meta property="og:title" content="Gua | 瓜地   - Page 3">
<meta property="og:description" content="I write many code to write less code.💻 - Página 3 ">
<meta property="og:site_name" content="Desgard_Duan">
<meta property="og:locale" content="pt_BR">
<meta property="og:type" content="website">
<meta property="og:author" content="https://www.facebook.com/desgard.duan">
<meta property="og:image" content="https://www.desgard.com">
<!-- Social: Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@nandomoreirame">
<meta name="twitter:domain" content="https://www.desgard.com">
<meta name="twitter:title" content="Gua | 瓜地   - Page 3">
<meta name="twitter:description" content="I write many code to write less code.💻 - Página 3 ">
<meta name="twitter:image:src" content="https://www.desgard.com">
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="114x114" href="https://www.desgard.com/assets/ico/apple-touch-icon-114-516f4e19976b9e4dbb77ad9b576831fe.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://www.desgard.com/assets/ico/apple-touch-icon-72-5409b2df229305703caf583d86c845ab.png">
<link rel="apple-touch-icon" href="https://www.desgard.com/assets/ico/apple-touch-icon-57-aa873e019cf659e0d4e6a0b5bb9f379d.png">
<link rel="shortcut icon" href="https://www.desgard.com/assets/ico/favicon-4298be3d3fbe23e18d65bded9d930899.png">
<!-- rel prev and next -->
  <link rel="prev" href="https://www.desgard.com/page/2">
  <link rel="next" href="https://www.desgard.com/page/4">
<!-- Canonical link tag -->
<link rel="canonical" href="https://www.desgard.com/page/3/">
<link rel="alternate" type="application/rss+xml" title="Gua" href="https://www.desgard.com/feed.xml">
<link rel="stylesheet" href="/assets/main-0b7b828712f4c43b75bba4861c907bb1.css">
<script src="/assets/modernizr-custom-cb807611a3e262b2eac59444cbab74d6.js" data-cfasync="false"></script>
<script src="/assets/js/jquery-3.1.js"></script>
<script src="/assets/js/jquery.rotate.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Website",
  "publisher": "www.desgard.com",
  "url": "http://www.desgard.com/",
  "description": "瓜地"
}
</script>
<script type="text/javascript">
  var disqus_shortname = 'desgard',
      baseurl          = '';
</script>
<!--
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-52446115-1']);
_gaq.push(['_trackPageview']);
(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>-->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?c5a8123bc51782a3083a631ed9ff50e4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'] ],
        displayMath: [ ['$$','$$'] ],
        processEscapes: true
      }
    });
  </script>
  </head>
  <body class="page-template home">
    <header class="header alt">
  <div class="container">
    <h1><a href="/"><strong>desgard</strong>.com</a></h1>
    <nav class="navbar">
      <ul>
        <li><a href="/">Home</a></li>
        <li><a href="#!" data-modal="modalSearch"><i class="fa fa-search"></i></a></li>
        <li><a href="/comment " target="_blank"><i class="fa fa-comments"></i></a></li>
        <li><a href="/feed.xml" target="_blank"><i class="fa fa-feed"></i></a></li>
      </ul>
    </nav>
  </div>
</header>
      <section class="banner">
  <img src="/assets/images/logo-new.png" alt="author thumb" class="dot animated hinge fadeInDown" id="avartor" width="120px">
  <h2 class="animated hinge fadeInDown" itemscope itemtype="http://schema.org/Person"><strong itemprop="name">Gua</strong><em itemprop="jobTitle">iOS Dev</em> and try everything!</h2>
  <nav class="actions">
    <a href="/about" class="button ghost">About</a>
    <a href="http://project.desgard.com" class="button ghost">Project</a>
  </nav>
</section>
<script>
    $("#avartor").mouseover();
</script>
    <main class="wrapper container" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/CFArray/" title="Permalink to CFArray 的历史渊源及实现原理">CFArray 的历史渊源及实现原理</a></h1>
  </header>
  <p><a href="/CFArray/" title="Permalink to CFArray 的历史渊源及实现原理" class="read-more">在 iOS 开发中，NSArray 是一个很重要的数据结构。尤其 TableView 中的数据缓存与更新， NSArray 来缓存数据以及对于显示数据的修改操作。而在 Core Foundation 中 CFArray 与 NSArray 相互对应，这引起了笔者对...</a></p>
  <footer class="post-meta">
    <time datetime="2017-02-02">
      <i class="fa fa-calendar-o"></i> 2017-02-02
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/CFArray/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/Load/" title="Permalink to load 方法全程跟踪">load 方法全程跟踪</a></h1>
  </header>
  <p><a href="/Load/" title="Permalink to load 方法全程跟踪" class="read-more">几天前 Github 的 RetVal 大神更新了可 debug 版本的 706 &lt;objc/runtime.h&gt; 源码，于是让源码阅读学习得以继续。本文将介绍个人学习 load 方法的全部流程。 load 方法的调用时机 从...</a></p>
  <footer class="post-meta">
    <time datetime="2017-01-16">
      <i class="fa fa-calendar-o"></i> 2017-01-16
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/Load/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/Running-Or-Safe/" title="Permalink to 玩转运动世界校园">玩转运动世界校园</a></h1>
  </header>
  <p><a href="/Running-Or-Safe/" title="Permalink to 玩转运动世界校园" class="read-more">原文链接：www.hackswjtu.com 作者：冬瓜 最近由于礼品机制，官方服务器人工查询可能较为严格。所以在实验的时候切勿使用个人账号进行脚本刷数据，以免造成被拉黑的情况。 上个礼拜，我们的小组织 HackSwjtu 破解了 运动世界校园 这款 app。与其说是破解 app，不如说是我们破解了它的网络接口。 以下是我们进行这个小项目的全部过程。 意外截获请求负载信息 运动世界校园 拥有一套很有意思的跑步规则，在选择目标距离后，在地图上回“随机”给出多个待检测点，而在这些点中，你必须要经过几个，路线随意，这样才完成了跑步评测的第一步。而在跑步结束后，软件还会计算你的跑步平均速度，如果偏差太大（过快或过慢）也不会记录成为有效成绩。 好奇心驱使下，我们对其进行抓包，想看一看大致的实现过程。我们分别对设置目标距离、产生随机点和上传数据三个请求进行了抓包，其结果如下（测试环境...</a></p>
  <footer class="post-meta">
    <time datetime="2016-11-03">
      <i class="fa fa-calendar-o"></i> 2016-11-03
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/Running-Or-Safe/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/SDWebImage3/" title="Permalink to SDWebImage Source Probe: Downloader">SDWebImage Source Probe: Downloader</a></h1>
  </header>
  <p><a href="/SDWebImage3/" title="Permalink to SDWebImage Source Probe: Downloader" class="read-more">为了进行图片下载操作，通过 SDWebImageManager 这座桥梁，有效控制了图片下载的时机和同缓存的协同操作。这篇来关注一下在 SD 中，Downloader Class 的具体实现。 Downloader 中的一些枚举 在 SDWebImageDownloader.m 中，可以发现这么一个属性： @property (strong, nonatomic)...</a></p>
  <footer class="post-meta">
    <time datetime="2016-10-04">
      <i class="fa fa-calendar-o"></i> 2016-10-04
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/SDWebImage3/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/isa/" title="Permalink to 用 isa 承载对象的类信息">用 isa 承载对象的类信息</a></h1>
  </header>
  <p><a href="/isa/" title="Permalink to 用 isa 承载对象的类信息" class="read-more">Effective Objective-C 2.0 - 52 Specific Ways to Improve Your iOS and OS X Programs...</a></p>
  <footer class="post-meta">
    <time datetime="2016-09-30">
      <i class="fa fa-calendar-o"></i> 2016-09-30
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/isa/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/SDWebImage2/" title="Permalink to SDWebImage Source Probe: Manager">SDWebImage Source Probe: Manager</a></h1>
  </header>
  <p><a href="/SDWebImage2/" title="Permalink to SDWebImage Source Probe: Manager" class="read-more">在 SDWebImage Source Probe: WebCache 一文中，通过最常用的 sd_setImageWithURL 方法，来分析源码。而在其中，对于图片的 download 方法，也是需要理解的重点之一。它用于处理异步下载和图片缓存的类，当然也可直接拿来使用。SDWebImageManager 这个类，为 WebCache 、 SDWebImageDownloader 和...</a></p>
  <footer class="post-meta">
    <time datetime="2016-09-15">
      <i class="fa fa-calendar-o"></i> 2016-09-15
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/SDWebImage2/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<nav class="pagination" role="pagination">
    <a class="older-posts" href="/page/4/" title="Articles old">Last</a>
  <span class="page-number">3 / 6</span>
      <a class="newer-posts" href="/page/2/" title="Articles new">Next</a>
</nav>
    </main>
<footer class="footer">
  <div class="container">
    <ul class="icons">
      <li>
        <a href="https://github.com/desgard" class="icon-github" target="_blank">
          <i class="fa fa-github"></i>
        </a>
      </li>
      <li>
        <a href="https://www.facebook.com/desgard.duan" class="icon-facebook" target="_blank">
          <i class="fa fa-facebook"></i>
        </a>
      </li>
      <li>
        <a href="https://twitter.com/Desgard_Duan" class="icon-twitter" target="_blank">
          <i class="fa fa-twitter"></i>
        </a>
      </li>
      <li>
        <a href="https://stackoverflow.com/users/6119149/desgard-duan" class="icon-github" target="_blank">
          <i class="fa fa-stack-overflow"></i>
        </a>
      </li>
      <li>
        <a href="https://weibo.com/desgard" class="icon-instagram" target="_blank">
          <i class="fa fa-weibo"></i>
        </a>
      </li>
    </ul>
    <p>
      <q>I write many code to write less code.💻</q>
      <small>– Gua</small>
    </p>
    <small class="clearfix">
      Powered by <a href="http://jekyllrb.com" target="_blank">Jekyll</a> • <a href="https://github.com/desgard" target="_blank">Open source <i class="fa fa-heart"></i></a>
    </small>
  </div>
</footer>
<a class="scroll-up fa fa-chevron-up bounce" href="#" data-position="0"></a>
<div id="modalSearch" class="modal">
  <div class="modal__overlay"></div>
  <div class="modal__content">
    <a href="#!" class="modal-close" data-modal-close>&times;</a>
    <div class="search-container">
      <input type="text" id="search-input" placeholder="Search articles">
      <ul id="results-container"></ul>
    </div>
  </div>
</div>
    <script src="/assets/main-52d417e8a6ff9f5b168386d37c96338a.js"></script>
  </body>
  <script>
    var link = "" ;
    var os = function() {  
      var ua = navigator.userAgent,  
      isWindowsPhone = /(?:Windows Phone)/.test(ua),  
      isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,   
      isAndroid = /(?:Android)/.test(ua),   
      isFireFox = /(?:Firefox)/.test(ua),   
      isChrome = /(?:Chrome|CriOS)/.test(ua),  
      isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),  
      isPhone = /(?:iPhone)/.test(ua) && !isTablet,  
      isPc = !isPhone && !isAndroid && !isSymbian;  
      return {  
        isTablet: isTablet,  
        isPhone: isPhone,  
        isAndroid : isAndroid,  
        isPc : isPc  
      };  
    }();  
    if (link.length > 0) {
      if (os.isAndroid || os.isPhone) {
        location.replace(link);
      }
    }
  </script>
</html>